import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { AnchorDynamicEntity } from '../../entity/dynamic';
import { AnchorDynamicService } from '../../service/dynamic';
import { AnchorDynamicTypeService } from '../../service/dynamic_type';

/**
 * anchorDynamic模块-动态信息
 */
@CoolController({
  prefix: "/apid/dynamic",
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: AnchorDynamicEntity,
  service: AnchorDynamicService,
  pageQueryOp: {
    keyWordLikeFields: ['anchorName', 'content'],
    fieldEq: ['type'],
  }
})
export class AdminAnchorDynamicController extends BaseController {
  @Inject()
  anchorDynamicService: AnchorDynamicService;

  @Inject()
  anchorDynamicTypeService:AnchorDynamicTypeService

  @Post('/unLockActivity', { summary: '解锁用户动态' })
  async unLockActivity(@Body() BodyData: any) {
    return this.ok(await this.anchorDynamicTypeService.unLockActivity(BodyData));
  }

}
